﻿//-----------------------------------------------------------------------
// <copyright file="IUser.cs" company="Craig Longford (deltawolf7@gmail.com)">
//     Copyright (c) Craig Longford. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Delta.Mercury.Business.User
{
    using System;
    using Delta.Data.DataExpress;

    /// <summary>
    /// IUser interface
    /// </summary>
    public interface IUser : IDataServicable
    {
        #region Properties
        /// <summary>
        /// Gets or sets the users firstname.
        /// </summary>
        string Firstname { get; set; }

        /// <summary>
        /// Gets the unique identifier of the user.
        /// </summary>
        Guid Guid { get; }

        /// <summary>
        /// Gets the fullname of the user
        /// </summary>
        string Fullname { get; }

        /// <summary>
        /// Gets or sets the user's lastname.
        /// </summary>
        string Lastname { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the user's account is active or inactive.
        /// </summary>
        bool AccountActive { get; set; }

        /// <summary>
        /// Gets the date and time the account was created.
        /// </summary>
        DateTime Created { get; }

        /// <summary>
        /// Gets the date and time the account was last accessed.
        /// </summary>
        DateTime LastAccess { get; }

        /// <summary>
        /// Gets or sets a value indicating whether the user is an administrator.
        /// </summary>
        bool IsAdministrator { get; set; }

        /// <summary>
        /// Gets or sets the users email address.
        /// </summary>
        string EmailAddress { get; set; }
        #endregion

        #region Methods
        /// <summary>
        /// Sets the user's password on successful match.
        /// </summary>
        /// <param name="currentPassword">Current password</param>
        /// <param name="newPassword">New password</param>
        void SetPassword(string currentPassword, string newPassword);

        /// <summary>
        /// Sets the user's password without checking the current password.
        /// </summary>
        /// <param name="newPassword">New password</param>
        void SetPassword(string newPassword);

        /// <summary>
        /// Check a password
        /// </summary>
        /// <param name="password">Password to check</param>
        /// <returns>True is correct, else false</returns>
        bool CheckPassword(string password);

        /// <summary>
        /// Get user's contacts
        /// </summary>
        /// <param name="showDeleted">Show deleted</param>
        /// <returns>Collection of user contacts</returns>
        Contacts GetContacts(bool showDeleted);

        /// <summary>
        /// Get user's preferences
        /// </summary>
        /// <returns>Collection of preferences</returns>
        Preferences GetPreferences();
        #endregion
    }
}
